package com.github.prontera.domain.enums;

import com.github.prontera.common.mybatis.handler.CodeEnum;

/**
 * 通用枚举类型
 */
public enum SystemAccountTypeEnum implements CodeEnum<SystemAccountTypeEnum> {

	ISSUE(0, "红包"), COTERIE(2, "圈子"), VIDEO(2, "查看视频"), TALEND(4, "达人付款"), TASK(5, "购买任务广场");

	private int code;
	private String desc;

	private SystemAccountTypeEnum(int code, String desc) {
		this.code = code;
	}

	/**
	 * 通过枚举<code>name</code>获取枚举
	 */
	public static SystemAccountTypeEnum getEnumByCode(Integer code) {
		if (code == null) {
			return null;
		}
		for (SystemAccountTypeEnum enumm : SystemAccountTypeEnum.values()) {
			if (enumm.getCode() == code.intValue()) {
				return enumm;
			}
		}
		return null;
	}

	@Override
	public int getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}

}
